#pragma once
#include<Socket.h>

using CallBackType = int(*)(SockEvent &);
class SockEvent
{
    SockBuffer data;
    CallBackType callback;
public:
    SockEvent(){}
    SockEvent(CallBackType fun):callback(fun){}
    SockEvent(int len):data(len){}
    virtual ~SockEvent(){}
    void setCallBack(CallBackType fun){
        callback = fun;
    }
    void bindSock(Socket * sock){
        
    }
    void trigger(){

    }
};
/*
template<typename T>
CallBackType creatCallBack(int(*fun)(T*)){
    return [&](SockEvent * event){
        return fun(static_cast<T*>(event));
    }
}
*/